﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yes.Domain.Enum;

namespace Yes.Domain.Entity
{
    /// <summary>
    /// 文章
    /// </summary>
    [Table("Article")]
    public class ArticleEntity : EntityBase
    {
        /// <summary>
        /// 作者ID
        /// </summary>
        public int UserId { get; set; }

        /// <summary>
        /// 分类ID
        /// </summary>
        public int CategoryId { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        [StringLength(50)]
        public string Title { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 封面图
        /// </summary>
        [StringLength(200)]
        public string Img { get; set; }

        /// <summary>
        /// 摘要
        /// </summary>
        [StringLength(200)]
        public string Summary { get; set; }

        /// <summary>
        /// 标签
        /// </summary>
        [StringLength(50)]
        public string Tag { get; set; }

        /// <summary>
        /// 发布时间
        /// </summary>
        public DateTime PublishDate { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime ModifyDate { get; set; }

        /// <summary>
        /// 是否允许评论
        /// </summary>
        public bool CanComment { get; set; }

        /// <summary>
        /// 评论数
        /// </summary>
        public int CommentCount { get; set; }

        /// <summary>
        /// 密码，不为空时需要输入密码才可查看
        /// </summary>
        [StringLength(32)]
        public string Password { get; set; }

        /// <summary>
        /// 排序值
        /// </summary>
        public int SortId { get; set; }

        /// <summary>
        /// 文章类型
        /// </summary>
        public ArticleTypeEnum Type { get; set; }

        /// <summary>
        /// 父文章ID
        /// </summary>
        public int ParentId { get; set; }

        /// <summary>
        /// 文章状态
        /// </summary>
        public ArticleStatusEnum Status { get; set; }

        /// <summary>
        /// 阅读数
        /// </summary>
        public int ReadCount { get; set; }

        /// <summary>
        /// 网页标题
        /// </summary>
        [StringLength(50)]
        public string SeoTitle { get; set; }

        /// <summary>
        /// 网页关键词
        /// </summary>
        [StringLength(50)]
        public string SeoKeywords { get; set; }

        /// <summary>
        /// 网页描述
        /// </summary>
        [StringLength(200)]
        public string SeoDescription { get; set; }

    }
}
